It is often desirable to modify the output of a physically based renderer that simulates light transport in a virtual scene. Many times the image generated by the renderer contains all the desired effects and looks roughly correct, but some amount of emphasis or adjustment is desired. Rather than re-render the scene, which can become costly if abused, the image can be manipulated through an “image composition” process that allows a user to manipulate less desirable effects without disrupting desirable effects. One tool available in image composition is light path expressions (LPE). LPEs are regular expressions adapted for light transport simulation.
Many physically based renderers generate light transport paths by projecting rays from a camera or light source, and importance-sampling or evaluating some or all components of the surface properties of the scene geometry. An LPE is a regular expression that defines characteristics of the light transport paths such that it catches paths matching those characteristics, or “criteria,” but not others, like a filter. Such criteria include the type of camera, lens, light source shape, light source type, emission characteristics and surface characteristics, among others. For example, LPEs can distinguish between a light transport path colliding with a diffuse surface versus a glossy surface. LPEs can also distinguish between a light transport path that experiences reflection versus refraction. Typically, light transport paths that match the LPE are evaluated and the results written to a buffer designated for the LPE.